package cc.vv.btpartyjob.partymanager.delegate

import android.widget.TextView
import cc.vv.baselibrary.view.BaseTopBarView
import cc.vv.btpartyjob.partymanager.R
import cc.vv.mvp.delegate.BaseAppDelegate

/**
 * 党员报到详情托管类
 * Created by Chen.qi on 2018/10/24.
 */
class PartyRegisterDetailActivityDelegate : BaseAppDelegate() {


    override fun initWidget() {
    }

    override fun initLayoutRes(): Int {
        return R.layout.activity_party_register_detail
    }

    /**设置标题title*/
    fun setTopBarTitle(topBarTitle: String) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_praD_topBar)
        titleBar?.setTitle(topBarTitle)
    }


    /**设置标题右边按钮点击事件*/
    fun setTitleBackBtnOnClick(event: BaseTopBarView.EventInterface) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_praD_topBar)
        titleBar?.setEventInterface(event)
    }

    /**
     * 设置姓名
     */
    fun setName(name: String?) {
        val viewDetail = getView<TextView>(R.id.tv_aprD_partyName)
        viewDetail?.text = name
    }

    /**
     * 设置街道
     */
    fun setStreet(str: String?) {
        val viewDetail = getView<TextView>(R.id.tv_aprD_registerStreetName)
        viewDetail?.text = str
    }

    /**
     * 设置社区
     */
    fun setSheQu(str: String?) {
        val viewDetail = getView<TextView>(R.id.tv_aprD_registerCommunityName)
        viewDetail?.text = str
    }

    /**
     * 设置电话
     */
    fun setPhone(str: String?) {
        val viewDetail = getView<TextView>(R.id.tv_aprD_telPhone)
        viewDetail?.text = str
    }

    /**
     * 设置职业
     */
    fun setZhiYe(str: String?) {
        val viewDetail = getView<TextView>(R.id.tv_aprD_professional)
        viewDetail?.text = str
    }

    /**
     * 设置工作时间
     */
    fun setWorkTime(str: String?) {
        val viewDetail = getView<TextView>(R.id.tv_aprD_workingHours)
        viewDetail?.text = str
    }

    /**
     * 设置特长爱好
     */
    fun setTeChang(str: String?) {
        val viewDetail = getView<TextView>(R.id.tv_aprD_loveIng)
        viewDetail?.text = str
    }

    /**
     * 设置承诺
     */
    fun setChengNuo(str: String?) {
        val viewDetail = getView<TextView>(R.id.tv_aprD_perPromise)
        viewDetail?.text = str
    }

    /**
     * 是否是志愿者
     */
    fun setVolunteer(volunteer: Int?) {
        val viewDetail = getView<TextView>(R.id.tv_aprD_isVolunteer)
        if (volunteer == 0) {
            viewDetail?.text = "是"
        } else {
            viewDetail?.text = "否"
        }

    }


}